/********************************
Creat Object: Function constructor
*/


function Person(name, yearOfBirth, job) {
    this.name = name;
    this.yearOfBirth = yearOfBirth;
    this.job = job;
}

Person.prototype.calculateAge = function() {
    console.log(2016 - this.yearOfBirth);
}

var john = new Person('John', 1990, 'teacher');
john.calculateAge();

var jane = new Person('Jane', 1991, 'developer');
jane.calculateAge();

console.log(john.calculateAge === jane.calculateAge);           // true
